package com.rjjs.Xiaozhi.controller;


import com.rjjs.Xiaozhi.assistant.XiaozhiAgent;
import com.rjjs.Xiaozhi.bean.ChatForm;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
@Tag(name = "学前小智")
@RequestMapping("/xiaozhi")
public class AppointmentController {

    @Autowired
    private XiaozhiAgent xiaozhiAgent;

    @Operation(summary = "教室助手")
    @PostMapping(value = "/chat")
    public String chat(@RequestBody ChatForm chatForm){
        return xiaozhiAgent.chat(chatForm.getUserId(), chatForm.getMessage());
    }

    @Operation(summary = "家园助手")
    @PostMapping(value = "/chat1")
    public  String chat1(@RequestBody ChatForm chatForm){
        return xiaozhiAgent.chat1(chatForm.getUserId(), chatForm.getMessage());
    }

    @Operation(summary = "预约观园")
    @PostMapping("/Appoint")
    public int Appoint(@RequestBody ChatForm chatForm){

        return 1;
    }
}
